{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"NLU_sentence_detection_example.ipynb","provenance":[],"collapsed_sections":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"ranKMTS37jDN"},"source":["![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/colab/component_examples/text_pre_processing_and_cleaning/NLU_sentence_detection_example.ipynb)\n","\n","# Detect sentences with NLU \n","\n","SentenceDetectorDL\n","SentenceDetectorDL (SDDL) is based on a general-purpose neural network model for sentence boundary detection. The task of sentence boundary detection is to identify sentences within a text. Many natural language processing tasks take a sentence as an input unit, such as part-of-speech tagging, dependency parsing, named entity recognition or machine translation.\n","\n","In this model, we treated the sentence boundary detection task as a classification problem using a DL CNN architecture. We also modified the original implemenation a little bit to cover broken sentences and some impossible end of line chars.\n","\n","We are releasing two pretrained SDDL models: english and multilanguage that are trained on SETimes corpus (Tyers and Alperen, 2010) and Europarl. Wong et al. (2014) datasets.\n","\n","Here are the test metrics on various languages for multilang model\n","![alt text]( \"Metrics\")\n","\n","\n","bg Bulgarian\n","\n","bs Bosnian\n","\n","de German\n","\n","el Greek\n","\n","en English\n","\n","hr Croatian\n","\n","mk Macedonian\n","\n","ro Romanian\n","\n","sq Albanian\n","\n","sr Serbian\n","\n","tr Turkish\n","\n","\n","## 1. Install NLU and Java 8"]},{"cell_type":"code","metadata":{"id":"c0qqCrWszHqD","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1619911229447,"user_tz":-120,"elapsed":118779,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"feded787-fc56-4c88-f04b-bd601f9198eb"},"source":["!wget https://setup.johnsnowlabs.com/nlu/colab.sh -O - | bash\n","\n","import nlu\n","import pandas as pd \n","pd.set_option('display.max_colwidth', -1)"],"execution_count":null,"outputs":[{"output_type":"stream","text":["--2021-05-01 23:18:31--  https://raw.githubusercontent.com/JohnSnowLabs/nlu/master/scripts/colab_setup.sh\n","Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...\n","Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.\n","HTTP request sent, awaiting response... 200 OK\n","Length: 1671 (1.6K) [text/plain]\n","Saving to: ‘STDOUT’\n","\n","\r-                     0%[                    ]       0  --.-KB/s               \rInstalling  NLU 3.0.0 with  PySpark 3.0.2 and Spark NLP 3.0.1 for Google Colab ...\n","-                   100%[===================>]   1.63K  --.-KB/s    in 0s      \n","\n","2021-05-01 23:18:31 (49.4 MB/s) - written to stdout [1671/1671]\n","\n","\u001b[K     |████████████████████████████████| 204.8MB 76kB/s \n","\u001b[K     |████████████████████████████████| 153kB 36.8MB/s \n","\u001b[K     |████████████████████████████████| 204kB 19.9MB/s \n","\u001b[K     |████████████████████████████████| 204kB 48.4MB/s \n","\u001b[?25h  Building wheel for pyspark (setup.py) ... \u001b[?25l\u001b[?25hdone\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"U901gdUaAdz0"},"source":["# 2. Load the SDLL model and predict the sentences"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":103},"id":"sFN76Dp_vG2k","executionInfo":{"status":"ok","timestamp":1619911229454,"user_tz":-120,"elapsed":118769,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"b7e06fed-4b3d-45e8-b259-36abe07d40e6"},"source":["text_data = '''\n","Denial is the most predictable of all human responses. But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.\n","I am the Architect. I created the Matrix. I've been waiting for you. You have many questions, and although the process has altered your consciousness, you remain irrevocably human. Ergo, some of my answers you will understand, and some of them you will not. Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.\n","Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix. You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision. While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control. Which has led you, inexorably, here.\n","Humph. Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.\n","The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program. After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion. Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.\n","There are two doors. The door to your right leads to the Source and the salvation of Zion. The door to your left leads back to the Matrix, to her... and to the end of your species. As you adequately put, the problem is choice. But we already know what you are going to do, don't we? Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason. An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.\n","As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level. While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself. Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.\n","The first matrix I designed was quite naturally perfect. It was a work of art. Flawless. Sublime. A triumph only equaled by its monumental failure.\n","If I am the father of the Matrix, she would undoubtedly be its mother.\n","'''\n","text_data"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"application/vnd.google.colaboratory.intrinsic+json":{"type":"string"},"text/plain":["\"\\nDenial is the most predictable of all human responses. But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.\\nI am the Architect. I created the Matrix. I've been waiting for you. You have many questions, and although the process has altered your consciousness, you remain irrevocably human. Ergo, some of my answers you will understand, and some of them you will not. Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.\\nYour life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix. You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision. While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control. Which has led you, inexorably, here.\\nHumph. Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.\\nThe function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program. After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion. Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.\\nThere are two doors. The door to your right leads to the Source and the salvation of Zion. The door to your left leads back to the Matrix, to her... and to the end of your species. As you adequately put, the problem is choice. But we already know what you are going to do, don't we? Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason. An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.\\nAs I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level. While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself. Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.\\nThe first matrix I designed was quite naturally perfect. It was a work of art. Flawless. Sublime. A triumph only equaled by its monumental failure.\\nIf I am the father of the Matrix, she would undoubtedly be its mother.\\n\""]},"metadata":{"tags":[]},"execution_count":2}]},{"cell_type":"code","metadata":{"id":"j7CAYGm97gHm","colab":{"base_uri":"https://localhost:8080/","height":1000},"executionInfo":{"status":"ok","timestamp":1619911268499,"user_tz":-120,"elapsed":157808,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"b2b10c26-f4fc-4902-8407-670fc2c8e38a"},"source":["\n","# sentence_detector is an alias for sentence_detector.deep . Both NLU references give you the SDLL model\n","sdll_pipe = nlu.load('sentence_detector.deep') \n","\n","# sentence_pipe = nlu.load('sentence_detector')\n","\n","\n","sdll_sentence_df = sdll_pipe.predict(text_data, output_level ='sentence')  \n","sdll_sentence_df"],"execution_count":null,"outputs":[{"output_type":"stream","text":["sentence_detector_dl download started this may take some time.\n","Approximate size to download 354.6 KB\n","[OK!]\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>sentence</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>Denial is the most predictable of all human responses.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>I am the Architect.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>I created the Matrix.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>I've been waiting for you.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>You have many questions, and although the process has altered your consciousness, you remain irrevocably human.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Ergo, some of my answers you will understand, and some of them you will not.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Which has led you, inexorably, here.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Humph.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program. After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>There are two doors.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The door to your right leads to the Source and the salvation of Zion.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The door to your left leads back to the Matrix, to her.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>.. and to the end of your species.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>As you adequately put, the problem is choice.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>But we already know what you are going to do, don't we?</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The first matrix I designed was quite naturally perfect.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>It was a work of art.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Flawless.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Sublime.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>A triumph only equaled by its monumental failure.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>If I am the father of the Matrix, she would undoubtedly be its mother.</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["                                                                                                                                                                                                                                                          sentence\n","0  Denial is the most predictable of all human responses.                                                                                                                                                                                                         \n","0  But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.                                                                                                                                           \n","0  I am the Architect.                                                                                                                                                                                                                                            \n","0  I created the Matrix.                                                                                                                                                                                                                                          \n","0  I've been waiting for you.                                                                                                                                                                                                                                     \n","0  You have many questions, and although the process has altered your consciousness, you remain irrevocably human.                                                                                                                                                \n","0  Ergo, some of my answers you will understand, and some of them you will not.                                                                                                                                                                                   \n","0  Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.                                                                                                                                  \n","0  Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.                                                                                                                                                       \n","0  You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.                                                                                          \n","0  While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control.                                                                                                                                                 \n","0  Which has led you, inexorably, here.                                                                                                                                                                                                                           \n","0  Humph.                                                                                                                                                                                                                                                         \n","0  Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.                                                                                                                                \n","0  The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program. After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion.\n","0  Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.                        \n","0  There are two doors.                                                                                                                                                                                                                                           \n","0  The door to your right leads to the Source and the salvation of Zion.                                                                                                                                                                                          \n","0  The door to your left leads back to the Matrix, to her.                                                                                                                                                                                                        \n","0  .. and to the end of your species.                                                                                                                                                                                                                             \n","0  As you adequately put, the problem is choice.                                                                                                                                                                                                                  \n","0  But we already know what you are going to do, don't we?                                                                                                                                                                                                        \n","0  Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason.                                                                                                        \n","0  An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.                                                                                                                       \n","0  As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level.                                 \n","0  While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself.                                                                                     \n","0  Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.                                                                                                                                                 \n","0  The first matrix I designed was quite naturally perfect.                                                                                                                                                                                                       \n","0  It was a work of art.                                                                                                                                                                                                                                          \n","0  Flawless.                                                                                                                                                                                                                                                      \n","0  Sublime.                                                                                                                                                                                                                                                       \n","0  A triumph only equaled by its monumental failure.                                                                                                                                                                                                              \n","0  If I am the father of the Matrix, she would undoubtedly be its mother.                                                                                                                                                                                         "]},"metadata":{"tags":[]},"execution_count":3}]},{"cell_type":"markdown","metadata":{"id":"ouB-AmiW_WHF"},"source":["# 3.  Lets compare the SDLL with the Pragmatic Sentence detector"]},{"cell_type":"code","metadata":{"id":"DFi8VWxq88c-","colab":{"base_uri":"https://localhost:8080/","height":1000},"executionInfo":{"status":"ok","timestamp":1619911269923,"user_tz":-120,"elapsed":159226,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"c1937b0b-8d19-4b59-9505-48123df287b9"},"source":["sentence_pragmatic_pipe = nlu.load('sentence_detector.pragmatic')\n","pragmatic_sentences_df = sentence_pragmatic_pipe.predict(text_data, output_level ='sentence')  \n","pragmatic_sentences_df"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>sentence</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>Denial is the most predictable of all human responses.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>I am the Architect.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>I created the Matrix.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>I've been waiting for you.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>You have many questions, and although the process has altered your consciousness, you remain irrevocably human.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Ergo, some of my answers you will understand, and some of them you will not.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Which has led you, inexorably, here.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Humph.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>There are two doors.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The door to your right leads to the Source and the salvation of Zion.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The door to your left leads back to the Matrix, to her.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>and to the end of your species.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>As you adequately put, the problem is choice.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>But we already know what you are going to do, don't we?</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>The first matrix I designed was quite naturally perfect.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>It was a work of art.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Flawless.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>Sublime.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>A triumph only equaled by its monumental failure.</td>\n","    </tr>\n","    <tr>\n","      <th>0</th>\n","      <td>If I am the father of the Matrix, she would undoubtedly be its mother.</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["                                                                                                                                                                                                                                  sentence\n","0  Denial is the most predictable of all human responses.                                                                                                                                                                                 \n","0  But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.                                                                                                                   \n","0  I am the Architect.                                                                                                                                                                                                                    \n","0  I created the Matrix.                                                                                                                                                                                                                  \n","0  I've been waiting for you.                                                                                                                                                                                                             \n","0  You have many questions, and although the process has altered your consciousness, you remain irrevocably human.                                                                                                                        \n","0  Ergo, some of my answers you will understand, and some of them you will not.                                                                                                                                                           \n","0  Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.                                                                                                          \n","0  Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.                                                                                                                               \n","0  You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.                                                                  \n","0  While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control.                                                                                                                         \n","0  Which has led you, inexorably, here.                                                                                                                                                                                                   \n","0  Humph.                                                                                                                                                                                                                                 \n","0  Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.                                                                                                        \n","0  The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program.                                                                                       \n","0  After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion.                                                                                                                         \n","0  Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.\n","0  There are two doors.                                                                                                                                                                                                                   \n","0  The door to your right leads to the Source and the salvation of Zion.                                                                                                                                                                  \n","0  The door to your left leads back to the Matrix, to her.                                                                                                                                                                                \n","0  .                                                                                                                                                                                                                                      \n","0  .                                                                                                                                                                                                                                      \n","0  and to the end of your species.                                                                                                                                                                                                        \n","0  As you adequately put, the problem is choice.                                                                                                                                                                                          \n","0  But we already know what you are going to do, don't we?                                                                                                                                                                                \n","0  Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason.                                                                                \n","0  An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.                                                                                               \n","0  As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level.         \n","0  While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself.                                                             \n","0  Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.                                                                                                                         \n","0  The first matrix I designed was quite naturally perfect.                                                                                                                                                                               \n","0  It was a work of art.                                                                                                                                                                                                                  \n","0  Flawless.                                                                                                                                                                                                                              \n","0  Sublime.                                                                                                                                                                                                                               \n","0  A triumph only equaled by its monumental failure.                                                                                                                                                                                      \n","0  If I am the father of the Matrix, she would undoubtedly be its mother.                                                                                                                                                                 "]},"metadata":{"tags":[]},"execution_count":4}]},{"cell_type":"markdown","metadata":{"id":"7g90T41_3P-Z"},"source":["# 4 Compare SDLL with Spacy"]},{"cell_type":"code","metadata":{"id":"R-eqoOTXxM0D"},"source":["!pip install spacy > /dev/null"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"UpwQxkvbNqJt","executionInfo":{"status":"ok","timestamp":1619911278067,"user_tz":-120,"elapsed":167362,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"b9e2ad02-be67-4b3e-9c4d-338a0f193f03"},"source":["sdll_df = sdll_pipe.predict(text_data)\n","print ('with John Snow Labs SentenceDetectorDL')\n","print ('===================================')\n","for i,sent in enumerate(sdll_df.sentence):  print(f'{i}: {sent}'.replace('\\n',''))\n","\n","print('\\n\\n')\n","import spacy\n","\n","print ('with Spacy Sentence Detection')\n","print ('===================================')\n","nlp = spacy.load(\"en_core_web_sm\")\n","for i,sent in enumerate(nlp(text_data).sents): print(f'{i}: {sent}'.replace('\\n',''))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["with John Snow Labs SentenceDetectorDL\n","===================================\n","0: Denial is the most predictable of all human responses.\n","1: But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.\n","2: I am the Architect.\n","3: I created the Matrix.\n","4: I've been waiting for you.\n","5: You have many questions, and although the process has altered your consciousness, you remain irrevocably human.\n","6: Ergo, some of my answers you will understand, and some of them you will not.\n","7: Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.\n","8: Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.\n","9: You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.\n","10: While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control.\n","11: Which has led you, inexorably, here.\n","12: Humph.\n","13: Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.\n","14: The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program. After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion.\n","15: Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.\n","16: There are two doors.\n","17: The door to your right leads to the Source and the salvation of Zion.\n","18: The door to your left leads back to the Matrix, to her.\n","19: .. and to the end of your species.\n","20: As you adequately put, the problem is choice.\n","21: But we already know what you are going to do, don't we?\n","22: Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason.\n","23: An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.\n","24: As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level.\n","25: While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself.\n","26: Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.\n","27: The first matrix I designed was quite naturally perfect.\n","28: It was a work of art.\n","29: Flawless.\n","30: Sublime.\n","31: A triumph only equaled by its monumental failure.\n","32: If I am the father of the Matrix, she would undoubtedly be its mother.\n","\n","\n","\n","with Spacy Sentence Detection\n","===================================\n","0: Denial is the most predictable of all human responses.\n","1: But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.\n","2: I am the Architect.\n","3: I created the Matrix.\n","4: I've been waiting for you.\n","5: You have many questions, and although the process has altered your consciousness, you remain irrevocably human.\n","6: Ergo, some of my answers you will understand, and some of them you will not.\n","7: Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.\n","8: Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.\n","9: You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.\n","10: While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control.\n","11: Which has led you, inexorably, here.Humph.\n","12: Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.\n","13: The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program.\n","14: After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion.\n","15: Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.\n","16: There are two doors.\n","17: The door to your right leads to the Source and the salvation of Zion.\n","18: The door to your left leads back to the Matrix, to her... and to the end of your species.\n","19: As you adequately put, the problem is choice.\n","20: But we already know what you are going to do, don't we?\n","21: Already I can see the chain reaction: the chemical precursors that signal the onset of an emotion, designed specifically to overwhelm logic and reason.\n","22: An emotion that is already blinding you to the simple and obvious truth: she is going to die and there is nothing you can do to stop it.\n","23: As I was saying, she stumbled upon a solution whereby nearly ninety-nine percent of the test subjects accepted the program provided they were given a choice - even if they were only aware of it at a near-unconscious level.\n","24: While this solution worked, it was fundamentally flawed, creating the otherwise contradictory systemic anomaly, that, if left unchecked, might threaten the system itself.\n","25: Ergo, those who refused the program, while a minority, would constitute an escalating probability of disaster.\n","26: The first matrix I designed was quite naturally perfect.\n","27: It was a work of art.\n","28: Flawless.\n","29: Sublime.\n","30: A triumph only equaled by its monumental failure.\n","31: If I am the father of the Matrix, she would undoubtedly be its mother.\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"WecT4_27xOJk","executionInfo":{"status":"ok","timestamp":1619911279481,"user_tz":-120,"elapsed":168771,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"dc478ba5-f1e6-4c1b-fa28-83156b980d77"},"source":["text = \"\"\"John loves Mary.Mary loves Peter\n","Peter loves Helen .Helen loves John; \n","Total: four people involved.\"\"\"\n","\n","sdll_df = sdll_pipe.predict(text)\n","print ('with John Snow Labs SentenceDetectorDL')\n","print ('===================================')\n","for i,sent in enumerate(sdll_df.sentence):  print(f'{i}: {sent}'.replace('\\n',''))\n","\n","print('\\n\\n')\n","import spacy\n","\n","print ('with Spacy Sentence Detection')\n","print ('===================================')\n","nlp = spacy.load(\"en_core_web_sm\")\n","for i,sent in enumerate(nlp(text).sents): print(f'{i}: {sent}'.replace('\\n',''))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["with John Snow Labs SentenceDetectorDL\n","===================================\n","0: John loves Mary.\n","1: Mary loves Peter Peter loves Helen .\n","2: Helen loves John;\n","3: Total: four people involved.\n","\n","\n","\n","with Spacy Sentence Detection\n","===================================\n","0: John loves Mary.\n","1: Mary loves Peter\n","2: Peter loves Helen .Helen\n","3: loves John; Total: four people involved.\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"KpQzabVLztHv"},"source":["# Compare the multi language sentence splitter for Cyrillic"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"3eYkZFKGyNEY","executionInfo":{"status":"ok","timestamp":1619911283453,"user_tz":-120,"elapsed":172738,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"bba182af-e104-46dd-b380-83d31d786752"},"source":["\n","cyrillic_text = '''\n","B чeтвъpтъĸ Gооglе oбяви няĸoлĸo aĸтyaлизaции нa cвoятa тъpcaчĸa, зaявявaйĸи чe e \n","въвeлa изĸycтвeн интeлeĸт (Аl) и мaшиннo oбyчeниe зa пoдoбpявaнe нa пoтpeбитeлcĸoтo изживявaнe.\n","Πoтpeбитeлитe вeчe мoгaт дa cи тaнaниĸaт, cвиpят или пeят мeлoдия нa пeceн нa Gооglе чpeз мoбилнoтo пpилoжeниe, \n","ĸaтo дoĸocнaт иĸoнaтa нa миĸpoфoнa и зaдaдaт въпpoca: Koя e тaзи пeceн?\n","Taнaниĸaнeтo в пpoдължeниe нa 10-15 ceĸyнди щe дaдe шaнc нa aлгopитъмa c мaшиннo oбyчeниe нa Gооglе дa нaмepи и извeдe peзyлтaт ĸoя e пpипявaнaтa пeceн.\n","Πoнacтoящeм фyнĸциятa e дocтъпнa нa aнглийcĸи eзиĸ зa Іоѕ и нa oĸoлo 20 eзиĸa зa Аndrоіd, \n","ĸaтo в бъдeщe и зa двeтe oпepaциoнни cиcтeми щe бъдe пpeдлoжeн eднaĸъв нaбop oт пoддъpжaни eзици, ĸaзвaт oт Gооglе.\n","Al aĸтyaлизaциитe нa тъpceщия гигaнт cъщo oбxвaщaт пpaвoпиca и oбщитe зaявĸи зa тъpceнe.\n","Cpeд пoдoбpeниятa e вĸлючeн нoв пpaвoпиceн aлгopитъм, ĸoйтo изпoлзвa нeвpoннa мpeжa \n","c дълбoĸo oбyчeниe, зa ĸoятo Gооglе твъpди, чe идвa cъc знaчитeлнo пoдoбpeнa cпocoбнocт зa \n","дeшифpиpaнe нa пpaвoпиcни гpeшĸи.\n","'''\n","multi_lang_sentence_deep_pipe = nlu.load('xx.sentence_detector')\n","multi_sentence_df = multi_lang_sentence_deep_pipe.predict(cyrillic_text,output_level ='sentence')\n","\n","\n","\n","print ('with John Snow Labs SentenceDetectorDL')\n","print ('===================================')\n","for i,sent in enumerate(multi_sentence_df.sentence):  print(f'{i}: {sent}'.replace('\\n',''))\n","\n","print('\\n\\n')\n","\n","print ('with Spacy Sentence Detection')\n","print ('===================================')\n","for i,sent in enumerate(nlp(cyrillic_text).sents):\n","    print(i, '\\t',str(sent).replace('\\n',''))# removing \\n to beutify printing"],"execution_count":null,"outputs":[{"output_type":"stream","text":["sentence_detector_dl download started this may take some time.\n","Approximate size to download 354.6 KB\n","[OK!]\n","with John Snow Labs SentenceDetectorDL\n","===================================\n","0: B чeтвъpтъĸ Gооglе oбяви няĸoлĸo aĸтyaлизaции нa cвoятa тъpcaчĸa, зaявявaйĸи чe e въвeлa изĸycтвeн интeлeĸт (Аl) и мaшиннo oбyчeниe зa пoдoбpявaнe нa пoтpeбитeлcĸoтo изживявaнe.\n","1: Πoтpeбитeлитe вeчe мoгaт дa cи тaнaниĸaт, cвиpят или пeят мeлoдия нa пeceн нa Gооglе чpeз мoбилнoтo пpилoжeниe, ĸaтo дoĸocнaт иĸoнaтa нa миĸpoфoнa и зaдaдaт въпpoca: Koя e тaзи пeceн?\n","2: Taнaниĸaнeтo в пpoдължeниe нa 10-15 ceĸyнди щe дaдe шaнc нa aлгopитъмa c мaшиннo oбyчeниe нa Gооglе дa нaмepи и извeдe peзyлтaт ĸoя e пpипявaнaтa пeceн.\n","3: Πoнacтoящeм фyнĸциятa e дocтъпнa нa aнглийcĸи eзиĸ зa Іоѕ и нa oĸoлo 20 eзиĸa зa Аndrоіd, ĸaтo в бъдeщe и зa двeтe oпepaциoнни cиcтeми щe бъдe пpeдлoжeн eднaĸъв нaбop oт пoддъpжaни eзици, ĸaзвaт oт Gооglе.\n","4: Al aĸтyaлизaциитe нa тъpceщия гигaнт cъщo oбxвaщaт пpaвoпиca и oбщитe зaявĸи зa тъpceнe.\n","5: Cpeд пoдoбpeниятa e вĸлючeн нoв пpaвoпиceн aлгopитъм, ĸoйтo изпoлзвa нeвpoннa мpeжa c дълбoĸo oбyчeниe, зa ĸoятo Gооglе твъpди, чe идвa cъc знaчитeлнo пoдoбpeнa cпocoбнocт зa дeшифpиpaнe нa пpaвoпиcни гpeшĸи.\n","\n","\n","\n","with Spacy Sentence Detection\n","===================================\n","0 \t B чeтвъpтъĸ Gооglе oбяви няĸoлĸo aĸтyaлизaции нa cвoятa тъpcaчĸa, зaявявaйĸи чe e въвeлa изĸycтвeн интeлeĸт (\n","1 \t Аl) и мaшиннo oбyчeниe\n","2 \t зa пoдoбpявaнe нa пoтpeбитeлcĸoтo изживявaнe.\n","3 \t Πoтpeбитeлитe вeчe мoгaт дa\n","4 \t cи тaнaниĸaт, cвиpят или пeят мeлoдия нa пeceн нa Gооglе чpeз мoбилнoтo пpилoжeниe, \n","5 \t ĸaтo\n","6 \t дoĸocнaт иĸoнaтa\n","7 \t нa миĸpoфoнa\n","8 \t и зaдaдaт въпpoca:\n","9 \t Koя e тaзи пeceн?\n","10 \t Taнaниĸaнeтo в пpoдължeниe нa\n","11 \t 10-15 ceĸyнди щe дaдe шaнc нa aлгopитъмa c мaшиннo oбyчeниe нa Gооglе\n","12 \t дa нaмepи и извeдe peзyлтaт ĸoя e пpипявaнaтa пeceн.\n","13 \t Πoнacтoящeм\n","14 \t фyнĸциятa e\n","15 \t дocтъпнa нa aнглийcĸи eзиĸ\n","16 \t зa\n","17 \t Іоѕ и нa oĸoлo 20 eзиĸa зa Аndrоіd, ĸaтo\n","18 \t в бъдeщe и зa двeтe oпepaциoнни cиcтeми щe бъдe пpeдлoжeн\n","19 \t eднaĸъв нaбop oт пoддъpжaни eзици, ĸaзвaт oт Gооglе.\n","20 \t Al aĸтyaлизaциитe нa\n","21 \t тъpceщия гигaнт\n","22 \t cъщo oбxвaщaт пpaвoпиca\n","23 \t и\n","24 \t oбщитe зaявĸи\n","25 \t зa тъpceнe.\n","26 \t Cpeд пoдoбpeниятa e вĸлючeн нoв пpaвoпиceн aлгopитъм, ĸoйтo изпoлзвa нeвpoннa мpeжa \n","27 \t c дълбoĸo oбyчeниe, зa\n","28 \t ĸoятo Gооglе твъpди, чe идвa\n","29 \t cъc знaчитeлнo пoдoбpeнa cпocoбнocт\n","30 \t зa \n","31 \t дeшифpиpaнe нa пpaвoпиcни гpeшĸи.\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"xUojIYeu4oOR"},"source":["# Compare the multi language sentence splitter for Greek"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"tjb0OpPp32ug","executionInfo":{"status":"ok","timestamp":1619911284089,"user_tz":-120,"elapsed":173369,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"2a12068a-b60c-4183-9138-668a0e01a70f"},"source":["gr_text= '''\n","Όπως ίσως θα γνωρίζει, όταν εγκαθιστάς μια νέα εφαρμογή, θα έχεις διαπιστώσει \n","λίγο μετά, ότι το PC αρχίζει να επιβραδύνεται. Στη συνέχεια, όταν επισκέπτεσαι την οθόνη ή από την διαχείριση εργασιών, θα διαπιστώσεις ότι η εν λόγω εφαρμογή έχει προστεθεί στη \n","λίστα των προγραμμάτων που εκκινούν αυτόματα, όταν ξεκινάς το PC.\n","Προφανώς, κάτι τέτοιο δεν αποτελεί μια ιδανική κατάσταση, ιδίως για τους λιγότερο γνώστες, οι \n","οποίοι ίσως δεν θα συνειδητοποιήσουν ότι κάτι τέτοιο συνέβη. Όσο περισσότερες εφαρμογές στη λίστα αυτή, τόσο πιο αργή γίνεται η \n","εκκίνηση, ιδίως αν πρόκειται για απαιτητικές εφαρμογές. Τα ευχάριστα νέα είναι ότι η τελευταία και πιο πρόσφατη preview build της έκδοσης των Windows 10 που θα καταφθάσει στο πρώτο μισό του 2021, οι εφαρμογές θα \n","ενημερώνουν το χρήστη ότι έχουν προστεθεί στη λίστα των εφαρμογών που εκκινούν μόλις ανοίγεις το PC.\n","'''\n","\n","\n","\n","\n","multi_sentence_df = multi_lang_sentence_deep_pipe.predict(gr_text,output_level ='sentence')\n","print ('with John Snow Labs SentenceDetectorDL')\n","print ('===================================')\n","for i,sent in enumerate(multi_sentence_df.sentence):  print(f'{i}: {sent}'.replace('\\n',''))\n","\n","\n","print('\\n\\n')\n","print ('with Spacy Sentence Detection')\n","print ('===================================')\n","for i,sent in enumerate(nlp(gr_text).sents):\n","    print(i, '\\t',str(sent).replace('\\n',''))# removing \\n to beutify printing"],"execution_count":null,"outputs":[{"output_type":"stream","text":["with John Snow Labs SentenceDetectorDL\n","===================================\n","0: Όπως ίσως θα γνωρίζει, όταν εγκαθιστάς μια νέα εφαρμογή, θα έχεις διαπιστώσει λίγο μετά, ότι το PC αρχίζει να επιβραδύνεται.\n","1: Στη συνέχεια, όταν επισκέπτεσαι την οθόνη ή από την διαχείριση εργασιών, θα διαπιστώσεις ότι η εν λόγω εφαρμογή έχει προστεθεί στη λίστα των προγραμμάτων που εκκινούν αυτόματα, όταν ξεκινάς το PC. Προφανώς, κάτι τέτοιο δεν αποτελεί μια ιδανική κατάσταση, ιδίως για τους λιγότερο γνώστες, οι οποίοι ίσως δεν θα συνειδητοποιήσουν ότι κάτι τέτοιο συνέβη.\n","2: Όσο περισσότερες εφαρμογές στη λίστα αυτή, τόσο πιο αργή γίνεται η εκκίνηση, ιδίως αν πρόκειται για απαιτητικές εφαρμογές.\n","3:  Τα ευχάριστα νέα είναι ότι η τελευταία και πιο πρόσφατη preview build της έκδοσης των Windows 10 που θα καταφθάσει στο πρώτο μισό του 2021, οι εφαρμογές θα ενημερώνουν το χρήστη ότι έχουν προστεθεί στη λίστα των εφαρμογών που εκκινούν μόλις ανοίγεις το PC.\n","\n","\n","\n","with Spacy Sentence Detection\n","===================================\n","0 \t Όπως ίσως θα γνωρίζει, όταν εγκαθιστάς μια\n","1 \t νέα εφαρμογή, θα έχεις διαπιστώσει \n","2 \t λίγο μετά, ότι το\n","3 \t PC αρχίζει να επιβραδύνεται.\n","4 \t Στη συνέχεια, όταν επισκέπτεσαι την οθόνη ή\n","5 \t από την διαχείριση εργασιών, θα διαπιστώσεις ότι η εν λόγω εφαρμογή έχει προστεθεί στη \n","6 \t λίστα των\n","7 \t προγραμμάτων που εκκινούν αυτόματα, όταν ξεκινάς το PC.\n","8 \t Προφανώς, κάτι τέτοιο δεν αποτελεί μια ιδανική κατάσταση, ιδίως για τους λιγότερο γνώστες, οι \n","9 \t οποίοι ίσως δεν θα συνειδητοποιήσουν ότι κάτι τέτοιο συνέβη.\n","10 \t Όσο περισσότερες εφαρμογές στη λίστα αυτή, τόσο πιο αργή γίνεται η εκκίνηση, ιδίως αν πρόκειται για απαιτητικές εφαρμογές.\n","11 \t Τα ευχάριστα νέα είναι ότι η τελευταία και πιο πρόσφατη preview build της έκδοσης των Windows 10\n","12 \t που\n","13 \t θα καταφθάσει\n","14 \t στο πρώτο μισό του 2021, οι εφαρμογές\n","15 \t θα ενημερώνουν το χρήστη ότι\n","16 \t έχουν προστεθεί στη λίστα\n","17 \t των εφαρμογών που εκκινούν μόλις ανοίγεις το PC.\n"],"name":"stdout"}]}]}